package second50;


import CommonStructure.TreeNode;

public class T0100 {
    public boolean isSameTree(TreeNode p, TreeNode q) {
        if (p == null && q == null) return true;
        if (p == null || q == null) return false;
        boolean a = p.val == q.val;
        boolean b = isSameTree(p.left, q.left);
        boolean c = isSameTree(p.right, q.right);
        return a && b && c;
    }
}
